<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\DbConnection\Model\Model;
/**
 */
class News extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'news';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [];

    public function categories()
    {
        return $this->belongsToMany(Categorie::class,'news_category','news_id','category_id');
    }

    public function member()
    {
        return $this->belongsTo(Member::class,'member_id','id');
    }
}